<template>
  <header class="header">
    <div class="container">
      <div class="logo">
        <h1>{{ title }}</h1>
      </div>
      <nav class="navigation">
        <a v-for="(item, index) in navItems" :key="index" :href="item.href" class="nav-link">
          {{ item.text }}
        </a>
      </nav>
    </div>
  </header>
</template>

<script>
export default {
  name: 'AppHeader',
  props: {
    title: {
      type: String,
      default: '项目名称'
    },
    navItems: {
      type: Array,
      default: () => [
        { text: '概述', href: '#overview' },
        { text: '特点', href: '#features' },
        { text: '技术栈', href: '#tech-stack' },
        { text: '团队', href: '#team' },
        { text: '联系我们', href: '#contact' }
      ]
    }
  }
}
</script>

<style scoped>
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 15px 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}

.navigation {
  display: flex;
  gap: 20px;
}

.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #4CAF50;
}

@media (max-width: 768px) {
  .navigation {
    display: none;
  }
}
</style>
